new Vue({
    el:'#app',
    data:{
        disabled:true,
        courtIds:[],     //全部法院
        mainLawyers:[] ,  //全部律师
        Case_law:{
            caseId:'',
            thirdParty:'',
            objectOfAction:'',
            agencyMoney:'',
            blendMoney:'',
            courtId:{
                courtId:''
            },
            stateSessionDate:'',
            sessionDate:'',
            causeOfAction:'',
            causeDetails:'',
            mainLawyer:{
                empId:''
            },
            version:'',
            comment:'',
            submitId:{
                userId:''
            }
        }
    },
    created(){
      this.init();  
    },
    methods:{
        init(){
            var caseid = localStorage.getItem("message01_caseid");
            //获取所有法院
            this.$http.post("http://localhost:8080/case_count/selectList",
                {emulateJSON:true}).then(result=>{
                var msg = eval("("+result.body+")")
                this.courtIds = msg.data;
            });
            //获取所有律师
            this.$http.post("http://localhost:8080/HrEmp/selectList",
                {emulateJSON:true}).then(result=>{
                var msg = eval("("+result.body+")");
                this.mainLawyers = msg.data;
            });
            this.Case_law.caseId = caseid;
        },
        onSubmit(){   //提交修改
            var data = JSON.stringify(this.Case_law);
            this.$http.post("http://localhost:8080/law/Case_update",
                {"data":data},{emulateJSON:true}).then(result=>{
                var msg = eval("("+result.body+")");
                alert(msg.data);
                //修改完成跳转到主页面去。
                window.location.href="Case_Message.html";
            });
        }
    }
});